package com.esri.android.map.popup;

import android.content.Context;
import android.widget.ScrollView;
import com.esri.android.map.popup.ArcGISPopupStyle;
import java.util.EnumSet;
import java.util.Set;

/* loaded from: classes.dex */
class a extends ScrollView implements ArcGISPopupStyle.IPopupStylable {
    PopupLayout a;

    /* JADX INFO: Access modifiers changed from: package-private */
    public a(Context context, PopupLayout popupLayout) {
        super(context);
        this.a = popupLayout;
        if (popupLayout.getStyle() != null) {
            applyStyle((ArcGISPopupStyle) this.a.getStyle(), ArcGISPopupStyle.STYLE_ELEMENT.POPUP_BACKGROUND);
        }
        addView(popupLayout.getLayout());
    }

    public void a(boolean z) {
        if (this.a.getTitleView() instanceof PopupEditable) {
            ((PopupEditable) this.a.getTitleView()).setEditMode(z);
        }
        if (this.a.getAttributesView() instanceof PopupEditable) {
            ((PopupEditable) this.a.getAttributesView()).setEditMode(z);
        }
        if (this.a.getMediaView() instanceof PopupEditable) {
            ((PopupEditable) this.a.getMediaView()).setEditMode(z);
        }
        if (this.a.getAttachmentsView() instanceof PopupEditable) {
            ((PopupEditable) this.a.getAttachmentsView()).setEditMode(z);
        }
    }

    public void a() {
        if (this.a.getTitleView() instanceof PopupRefreshable) {
            ((PopupRefreshable) this.a.getTitleView()).refresh();
        }
        if (this.a.getAttributesView() instanceof PopupRefreshable) {
            ((PopupRefreshable) this.a.getAttributesView()).refresh();
        }
        if (this.a.getMediaView() instanceof PopupRefreshable) {
            ((PopupRefreshable) this.a.getMediaView()).refresh();
        }
        if (this.a.getAttachmentsView() instanceof PopupRefreshable) {
            ((PopupRefreshable) this.a.getAttachmentsView()).refresh();
        }
        postInvalidate();
    }

    @Override // com.esri.android.map.popup.ArcGISPopupStyle.IPopupStylable
    public Set<ArcGISPopupStyle.STYLE_ELEMENT> getRegisteredStyle() {
        return EnumSet.of(ArcGISPopupStyle.STYLE_ELEMENT.POPUP_BACKGROUND);
    }

    @Override // com.esri.android.map.popup.ArcGISPopupStyle.IPopupStylable
    public void applyStyle(ArcGISPopupStyle arcGISPopupStyle, ArcGISPopupStyle.STYLE_ELEMENT style_element) {
        setBackgroundColor(arcGISPopupStyle.getPopupBackgroundColor());
    }
}
